<template>
  <div>
    <button @click="getStudents">获取学生的信息</button>
    <button @click="getCars">获取车的信息</button>
</div>
</template>



<script>
  import axios from 'axios'
  export default {
    name: 'App',
    methods:{
      getStudents(){
        axios.get('http://localhost:8080/hello/students').then(
          response => {
            console.log('success',response.data);
          },
          error => {
            console.log('error',error.message);
          }
        )
      },
      getCars(){
        axios.get('http://localhost:8080/lookcar/cars').then(
          response => {
            console.log('success',response.data);
          },
          error => {
            console.log('error',error.message);
          }
        )
      }
    }
  }
</script>
